#ifndef RT_MD5_H__
#define RT_MD5_H__

#ifdef  __cplusplus
extern "C" {
#endif
	/* typedef a 32 bit type */
	typedef unsigned int UINT4;

	/* Data structure for MD5 (Message Digest) computation */
	typedef struct {
	  UINT4 i[2];                   /* number of _bits_ handled mod 2^64 */
	  UINT4 buf[4];                                    /* scratch buffer */
	  unsigned char in[64];                              /* input buffer */
	  unsigned char digest[16];     /* actual digest after MD5Final call */
	} MD5_CTX;

	RT_API_EXPORT void RtMD5Init (MD5_CTX *mdContext);
	RT_API_EXPORT void RtMD5Update (MD5_CTX *mdContext,
							const unsigned char *inBuf,
							unsigned int inLen);
	RT_API_EXPORT void RtMD5Final (MD5_CTX *mdContext);

	RT_API_EXPORT unsigned char* RtMD5 (const unsigned char* d, unsigned long n, unsigned char* md);
	RT_API_EXPORT char* RtMD5_hex_digest(unsigned char* md);

#ifdef  __cplusplus
}
#endif

#endif
